package com.xiongwei.compasite;

import java.util.ArrayList;
import java.util.List;

public class University extends Organization {

    List<Organization> colleges = new ArrayList<>();

    public University(String name) {
        super(name);
    }

    @Override
    public void add(Organization o) {
        colleges.add(o);
    }

    @Override
    public void remove(Organization o) {
        colleges.remove(o);
    }

    @Override
    public void print() {
        System.out.println("--------------" + getName() + "--------------");
        for (Organization college : colleges) {
            college.print();
        }
    }
}
